﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NorthWin_Test.Biz;
using System.Collections;
using NorthWin_Test.Entity;
using NorthWin_Test.form;

namespace NorthWin_Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            
        }

        private void Form1_Load(object sender, EventArgs e)
        {
          
        }

        private void btnInsrt_Click(object sender, EventArgs e)
        {

            Insert();
        }
        private void Insert()
        {
            UserEntity enUser = new UserEntity();
            enUser.UserID = txtUserID.Text.ToString();
            enUser.UserName = txtUserName.Text.ToString();
            

            UserBiz bizUser = new UserBiz();
            int result = bizUser.AddUser(enUser);
            if (result == 0)
            {
                lblError.Text = "khong insert duoc du lieu";
            }
            else
            {
                lblError.Text = "ban da insert thanh cong";
            }

            
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            Update up = new Update();
            up.ShowDialog();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            datagird data = new datagird();
            data.ShowDialog();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Listview lstview = new Listview();
            lstview.ShowDialog();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            datagird data = new datagird();
            data.ShowDialog();
        }
    }
}
